<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>学生信息列表</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="../bootstrap/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div id="container" style="width:900px">


    <div id="menu" style="background-color:#FFD700;height:200px;width:100px;float:left;">
        <nav class="navbar bg-light">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" href="../Student/list.do">学生</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="../Teacher/list.do">教师</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="../Course/list.do">课程</a>
                </li>
            </ul>
        </nav></div>


    <div id="content" style="background-color:#EEEEEE;height:200px;width:800px;float:left;">
        <table class="table table-striped">
            <thead>
            <tr>
                <th>id</th>
                <th>name</th>
                <th>教师名</th>

            </tr>
            </thead>
            <tbody>
            <tr th:each="course:${courses}">
                <td th:text="${course.id}"/>
                <td th:text="${course.name}"/>
<!--                <td th:text="${course.teacher.name}"/>-->
                <td>
                    <div th:each="teacher:${course.teachers}">
                        <span th:text="${teacher.name}"/>
                    </div>
                </td>

                <td ><a th:href="@{delete.do(id=${course.id})}">删除</a>
                    <a th:href="@{toUpdate.do(id=${course.id})}">修改</a>
                </td>
            </tr>
            </tbody>
        </table>
        <nav aria-label="Page navigation example">
            <ul class="pagination">
                <li class="page-item"><a class="page-link" th:href="@{/Course/list.do(currPage=(${currPage}-1),pageSize=3)}">Previous</a></li>
                <li class="page-item"><a class="page-link" th:href="@{/Course/list.do?currPage=1&pageSize=3}">1</a></li>
                <li class="page-item"><a class="page-link" th:href="@{/Course/list.do?currPage=2&pageSize=3}">2</a></li>
                <li class="page-item"><a class="page-link" th:href="@{/Course/list.do?currPage=3&pageSize=3}">3</a></li>
                <li class="page-item"><a class="page-link" th:href="@{/Course/list.do(currPage=(${currPage}+1),pageSize=3)}">next</a></li>
            </ul>
        </nav>
        <a href="../Product/getPage.do?page=addStudent">return to 新增学生</a>
    </div>
</body>


</html>